#!/sbin/openrc-run
description="innernet VPN coordination server"

# To manage the wireguard interface named "ifname", link this file
# to /etc/init.d/innernet-server.ifname and start that service
interface="${RC_SVCNAME##*.}"

command="/usr/sbin/innernet-server"
command_args="serve $interface $command_extra_args"
command_background=true
pidfile="/run/${RC_SVCNAME}.pid"

stop_post() {
	/usr/sbin/innernet down $interface
}

depend() {
	use net
}
